syms x


%Part A
disp('Part A')
myFun=x^3-2*x^2-5;

range = [1,4];

falsePositionMethod(myFun, range, 10^-4,50)

%Part B
disp('Part B')
myFun=x^3+3*x^2-1;

range = [-3,-2];

falsePositionMethod(myFun, range, 10^-4,50)

%Part C
disp('Part C')
myFun=x-cos(x);

range = [0,pi/2];

falsePositionMethod(myFun, range, 10^-4,50)

%Part D
disp('Part D')
myFun=x-0.8-0.2*sin(x);

range = [0,pi/2];

falsePositionMethod(myFun, range, 10^-4,50)
